---
title: Errors
---

import Seo from '../../../components/Seo.astro'
import Badge from '../../../components/Badge.astro'

<Seo
    seo={{
        title: 'Errors',
        description: 'Errors Unistyles will throw',
    }}
>

<Badge label="All platforms" />
<Badge label="2.0.0" />

Unistyles will only throw errors when it is used incorrectly.

### RuntimeUnavailable

:::danger[RuntimeUnavailable]
*"Unistyles runtime is not available. Make sure you followed the installation instructions"*
:::

This error will be thrown if you try to use Unistyles before it was initialized.
Make sure you followed the installation [setup](/start/setup/).

Still getting this error? Check [FAQ](/reference/faq/).

### ThemeNotFound / ThemeNotRegistered

:::danger[ThemeNotFound / ThemeNotRegistered]
*"You are trying to get a theme that is not registered with UnistylesRegistry"*

and

*"You are trying to set a theme that was not registered with UnistylesRegistry"*
:::


These errors occur when you call `UnistylesRuntime.setTheme` with a theme that has not been registered with `UnistylesRegistry`.
This situation can arise if you don't use TypeScript. Confirm that all your themes are registered with `UnistylesRegistry.addThemes` before using them.

### ThemeNotSelected

:::danger[ThemeNotSelected]
*"Your platform doesn't support adaptive themes"*
:::

This error is thrown if you have registered multiple themes but failed to select an initial one.

Follow theming [guide](/reference/theming/) to learn how to select the initial theme.

### AdaptiveThemesNotSupported

:::danger[AdaptiveThemesNotSupported]
*"Your platform doesn't support adaptive themes"*
:::

This error is thrown if you try to use adaptive themes on unsupported platform like visionOS.

To fix this issue, you need to remove `adaptiveThemes` options from `UnistylesRegistry`.

### ThemesCannotBeEmpty

:::danger[ThemesCannotBeEmpty]
*"You are trying to register empty themes object"*
:::

This error occurs if you attempt to register an empty themes object with  `UnistylesRegistry.addThemes`.

The `addThemes` method expects a key-value pair with at least one theme.

Follow theming [guide](/reference/theming/) to learn how to register your themes.

If you don't want to use themes, simply don't register them.

### BreakpointsCannotBeEmpty

:::danger[BreakpointsCannotBeEmpty]
*"You are trying to register empty breakpoints object"*
:::

This error will be thrown if you try to register empty breakpoints object with `UnistylesRegistry.addBreakpoints`.

Breakpoints are optional, if you don't want to use them, simply don't register them.

### BreakpointsMustStartFromZero

:::danger[BreakpointsMustStartFromZero]
*"You are trying to register breakpoints that don't start from 0"*
:::

This error occurs when you attempt to register breakpoints that do not start from 0.
Begin your first breakpoint with a value of 0 to mimic CSS cascade.

### InvalidPluginName

:::danger[InvalidPluginName]
*"Plugin name can't start from reserved prefix __unistyles"*
:::

This error is thrown if you attempt to register a plugin with a name that begins with the `__unistyles` prefix.
This prefix is reserved for Unistyles' internal plugins.

### DuplicatePluginName

:::danger[DuplicatePluginName]
*"You are trying to register a plugin with a name that is already registered"*
:::

This error occurs when you attempt to register a plugin with a name that has already been registered.
Review your list of plugins. Perhaps you included the same plugin twice? Or, maybe a plugin with the same name has already been created by someone from the community?

### CantRemoveInternalPlugin

:::danger[CantRemoveInternalPlugin]
*"You are trying to remove an internal unistyles plugin"*
:::

This error is thrown if you attempt to remove an internal Unistyles plugin.
Currently, it's not possible to remove internal plugins as they are essential for Unistyles to function properly.

</Seo>
